package com.ccb.sc.common.modules.live.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;

/**
 * @author ken
 * @version 1.0
 * @date 2022-07-30 21:48
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@Getter
public enum LiveStreamingOrderSource implements IEnum<Integer> {

    /**
     * 抖音
     */
    DOU_YIN(1, "抖音"),

    /**
     * 小红书
     */
    XIAO_HONG_SHU(2, "小红书");

    private int value;
    private String desc;

    LiveStreamingOrderSource(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public static LiveStreamingOrderSource getByValue(int value) {
        for (LiveStreamingOrderSource liveStreamingOrderSource : LiveStreamingOrderSource.values()) {
            if (liveStreamingOrderSource.getValue() == value) {
                return liveStreamingOrderSource;
            }
        }
        return null;
    }
}
